<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: LQ
  Date: 2021/5/19
  Time: 19:20
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script type="text/javascript" src="/jQuery/jquery-3.4.1.min.js"></script>
    <link type="text/css" rel="stylesheet" href="/css/document.css">
</head>
<body>
<div>
    <jsp:include page="main.jsp"/>
</div>

<div style="margin-left: 10%;margin-top: 1%">
    <div class="document_div">
        <h2>文件管理</h2>
        <div id="upload_div" class="upload_div">
            <form action="/uploading" method="post" enctype="multipart/form-data">
                <input id="upload" class="upload_input" type="file" name="file" onchange="showFileName()">
                <h3 id="fileName"></h3><input id="submit" class="submit" type="submit" value="上传文件">
            </form>
        </div>


        <div class="tableDiv">

            <c:forEach items="${requestScope.documentList}" var="document">
                <span>
                    <div class="document">
                    <img src="/img/fileicon.png" class="fileIcon">
                    <p class="fileFullName">${document.documentName}.${document.documentExtension}</p>
                    <form action="/deleteDocument?dId=${document.documentId}" method="post">
                        <button class="fileBtn" type="submit">删除</button>
                    </form>
                </div>
                </span>
            </c:forEach>

        </div>
    </div>
</div>

</body>
<script type="text/javascript" src="/js/document.js"></script>
</html>
